<template>
  <div class="wrapper">
    <van-tabbar v-model="$store.state.active">
      <router-link to="/" tag="div"
        ><van-tabbar-item icon="home-o" >首页</van-tabbar-item></router-link
      >
      <div>
      <van-tabbar-item icon="plus" @click="needLogin1">发表</van-tabbar-item>
      </div>
      <div>
        <van-tabbar-item icon="contact" @click="needLogin">我的</van-tabbar-item>
      </div>

    </van-tabbar>
  </div>
</template>

<script>
export default {
  name:'Footer',
  data() {
    return {
      // active: 0,
    };
  },
  methods:{
    needLogin(){
      if(this.$store.state.isLogin){
        this.$router.push('/mine')
      }else{
        this.$router.push('/login')
      }
    },
    needLogin1(){
      if(this.$store.state.isLogin){
        this.$router.push('/publish')
      }else{
        this.$router.push('/login')
      }
    }
  }
};
</script>
<style scoped lang="less">
/deep/.van-tabbar{
    justify-content: space-around;
}
</style>